<?php
error_reporting(0);
$isadmin=1;
include_once '../comm/config.php';
include '../comm/checkpostandget.php';
include 'check.php';

$ddusername=$_POST['ddusername']; 

$sql="select Id from ".$BIAOTOU."user where ddusername='".$ddusername."'";
$query=mysql_query($sql);
$row=mysql_fetch_array($query);
$dduserid=$row['Id'];

$q = "delete from ".$BIAOTOU."user where ddusername='$ddusername'";
mysql_query($q);
$q = "delete from ".$BIAOTOU."tixian where ddusername='$ddusername'";
mysql_query($q);
$q = "delete from ".$BIAOTOU."mingxi where ddusername='$ddusername'";
mysql_query($q);
$q = "delete from ".$BIAOTOU."msg where ddusername='$ddusername'";
mysql_query($q);
$q = "update ".$BIAOTOU."user set tjr=NULL where tjr='$dduserid'";
mysql_query($q);
$q = "update ".$BIAOTOU."tradelist set outer_code='' where outer_code='$dduserid'";
mysql_query($q); 

$sql="delete from ".$BIAOTOU."apilogin where dduserid='$dduserid'";
mysql_query($sql); 

mysql_close($link);

if(UC==1){
    include '../data/config.inc.php';
	include '../uc_client/client.php';
	uc_user_delete($dduserid);	
	//echo uc_user_delete($ddusername);	
}

admin_log('删除会员');
header('Location: userlist.php');  
?>